Understanding and creating expressions for search limits

Before you create a search limit, you must determine what expressions you may need for the search expression to be used for the limit. An expression may be a single operand (search field with a desired value), a combination of operands, or even a combination of combined operands. In Searching, an expression can be a simple expression, or a complex expression.

  • A simple expression is an operand that is used on its own as an expression. Examples of simple expressions include “LIBRARY = Main Library,” and “TITLE contains ‘cat’.”
  • A complex expression is the combination of two or more operands or combined operands, using the operator AND or OR. Examples of complex expressions are “PUBDATE >=1900 AND PUBDATE <=1950,” and “LIBRARY = Main Library OR LIBRARY = North Branch.”

The two operators that can be used to create complex expression are AND and OR.

  • AND will create an expression to produce a search results list of items that match both the first operand and the second operand.
  • OR will create an expression to produce a search results list of items that match either the first operand, or the second operand.

A complex expression, as used in Searching, can be likened to a combination of search criteria. For example, the patron may want to limit the search results to include only items that are published in Spanish and have a publication date after 2005. In this case, “LANGUAGE = Spanish” is the first search criterion, or the first operand, and “PUBDATE >= 2005” is the second search criterion, or second operand. Since the patron wants a search results list of only those materials that meet both search criteria, the administrator would create the search expression with the AND operator to join both operands into one expression, as follows.

“LANGUAGE = Spanish” AND “PUBDATE >= 2005”

The following topics explain how to create complex expressions, and give examples of simple and complex expressions: